home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 January: Mac OS SDK / Dev.CD Jan 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / PInterfaces / RAVE.p < prev    next >
Encoding:
Text File  |  1998-08-17  |  37.1 KB  |  922 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        RAVE.p
  3.  
  4.      Contains:    Interface for RAVE (Renderer Acceleration Virtual Engine)                            
  5.  
  6.      Version:    Technology:    Quickdraw 3D 1.5.4
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. }
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT RAVE;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __RAVE__}
  27. {$SETC __RAVE__ := 1}
  28.  
  29. {$I+}
  30. {$SETC RAVEIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33. {$IFC UNDEFINED __CONDITIONALMACROS__}
  34. {$I ConditionalMacros.p}
  35. {$ENDC}
  36.  
  37. {$IFC TARGET_OS_MAC }
  38. {$IFC UNDEFINED __MACTYPES__}
  39. {$I MacTypes.p}
  40. {$ENDC}
  41. {$IFC UNDEFINED __QUICKDRAW__}
  42. {$I Quickdraw.p}
  43. {$ENDC}
  44. {$IFC UNDEFINED __QDOFFSCREEN__}
  45. {$I QDOffscreen.p}
  46. {$ENDC}
  47.  
  48. {$ENDC}  {TARGET_OS_MAC}
  49.  
  50. {$IFC TARGET_OS_WIN32 }
  51. {$IFC UNDEFINED RAVE_NO_DIRECTDRAW }
  52. {$ENDC}
  53. {$ENDC}  {TARGET_OS_WIN32}
  54.  
  55.  
  56. {$PUSH}
  57. {$ALIGN POWER}
  58. {$LibExport+}
  59.  
  60. {*****************************************************************************
  61.  *
  62.  * Platform dependent datatypes: TQAImagePixelType, TQADevice, TQAClip, and TQARect.
  63.  *
  64.  ****************************************************************************}
  65.  
  66. TYPE
  67.     TQAImagePixelType             = LONGINT;
  68. CONST
  69.     kQAPixel_Alpha1                = {TQAImagePixelType}0;            {  1 bit/pixel alpha  }
  70.     kQAPixel_RGB16                = {TQAImagePixelType}1;            {  16 bit/pixel, R=14:10, G=9:5, B=4:0  }
  71.     kQAPixel_ARGB16                = {TQAImagePixelType}2;            {  16 bit/pixel, A=15, R=14:10, G=9:5, B=4:0  }
  72.     kQAPixel_RGB32                = {TQAImagePixelType}3;            {  32 bit/pixel, R=23:16, G=15:8, B=7:0  }
  73.     kQAPixel_ARGB32                = {TQAImagePixelType}4;            {  32 bit/pixel, A=31:24, R=23:16, G=15:8, B=7:0  }
  74.     kQAPixel_CL4                = {TQAImagePixelType}5;            {  4 bit color look up table, always big endian, ie high 4 bits effect left pixel  }
  75.     kQAPixel_CL8                = {TQAImagePixelType}6;            {  8 bit color look up table  }
  76.     kQAPixel_RGB16_565            = {TQAImagePixelType}7;            {  16 bits/pixel, no alpha, R:5, G:6, B:5 WINDOWS ONLY  }
  77.     kQAPixel_RGB24                = {TQAImagePixelType}8;            {  24 bits/pixel, no alpha, R:8, G:8, B:8 WINDOWS ONLY  }
  78.  
  79.  
  80. TYPE
  81.     TQAColorTableType             = LONGINT;
  82. CONST
  83.     kQAColorTable_CL8_RGB32        = {TQAColorTableType}0;            {  256 entry, 32 bit/pixel, R=23:16, G=15:8, B=7:0  }
  84.     kQAColorTable_CL4_RGB32        = {TQAColorTableType}1;            {  16 entry, 32 bit/pixel, R=23:16, G=15:8, B=7:0  }
  85.  
  86. { Selects target device type }
  87.  
  88. TYPE
  89.     TQADeviceType                 = LONGINT;
  90. CONST
  91.     kQADeviceMemory                = {TQADeviceType}0;                {  Memory draw context  }
  92.     kQADeviceGDevice            = {TQADeviceType}1;                {  Macintosh GDevice draw context  }
  93.     kQADeviceWin32DC            = {TQADeviceType}2;                {  Win32 DC  }
  94.     kQADeviceDDSurface            = {TQADeviceType}3;                {  Win32 DirectDraw Surface  }
  95.  
  96. { Generic memory pixmap device }
  97.  
  98. TYPE
  99.     TQADeviceMemoryPtr = ^TQADeviceMemory;
  100.     TQADeviceMemory = RECORD
  101.         rowBytes:                LONGINT;                                {  Rowbytes  }
  102.         pixelType:                TQAImagePixelType;                        {  Depth, color space, etc.  }
  103.         width:                    LONGINT;                                {  Width in pixels  }
  104.         height:                    LONGINT;                                {  Height in pixels  }
  105.         baseAddr:                Ptr;                                    {  Base address of pixmap  }
  106.     END;
  107.  
  108. { Selects target clip type }
  109.     TQAClipType                 = LONGINT;
  110. CONST
  111.     kQAClipRgn                    = {TQAClipType}0;                {  Macintosh clipRgn with serial number  }
  112.     kQAClipWin32Rgn                = {TQAClipType}1;                {  Win32 clip region  }
  113.  
  114.  
  115. TYPE
  116.     TQARectPtr = ^TQARect;
  117.     TQARect = RECORD
  118.         left:                    LONGINT;
  119.         right:                    LONGINT;
  120.         top:                    LONGINT;
  121.         bottom:                    LONGINT;
  122.     END;
  123.  
  124. {$IFC TARGET_OS_MAC }
  125.     TQAPlatformDevicePtr = ^TQAPlatformDevice;
  126.     TQAPlatformDevice = RECORD
  127.         CASE INTEGER OF
  128.         0: (
  129.             memoryDevice:        TQADeviceMemory;
  130.             );
  131.         1: (
  132.             gDevice:            GDHandle;
  133.             );
  134.     END;
  135.  
  136.     TQAPlatformClipPtr = ^TQAPlatformClip;
  137.     TQAPlatformClip = RECORD
  138.         CASE INTEGER OF
  139.         0: (
  140.             clipRgn:            RgnHandle;
  141.             );
  142.     END;
  143.  
  144. {$IFC TYPED_FUNCTION_POINTERS}
  145.     TQADrawNotificationProcPtr = PROCEDURE(left: INTEGER; top: INTEGER; right: INTEGER; bottom: INTEGER; refCon: LONGINT);
  146. {$ELSEC}
  147.     TQADrawNotificationProcPtr = ProcPtr;
  148. {$ENDC}
  149.  
  150.     TQADrawNotificationProcRefNum        = LONGINT;
  151. { used to unregister your proc }
  152. {$ELSEC}
  153. {$IFC TARGET_OS_WIN32 }
  154. {$ELSEC}
  155. {
  156.      * Generic platform supports memory device only. TQARect is generic. TQAClip is ???.
  157.      }
  158.     TQAPlatformDevice = RECORD
  159.         CASE INTEGER OF
  160.         0: (
  161.             memoryDevice:        TQADeviceMemory;
  162.             );
  163.     END;
  164.  
  165.     TQAPlatformClip = RECORD
  166.         CASE INTEGER OF
  167.         0: (
  168.             region:                Ptr;                                    {  ???  }
  169.             );
  170.     END;
  171.  
  172. {$ENDC}
  173. {$ENDC}
  174.  
  175.     TQADevicePtr = ^TQADevice;
  176.     TQADevice = RECORD
  177.         deviceType:                TQADeviceType;
  178.         device:                    TQAPlatformDevice;
  179.     END;
  180.  
  181.     TQAClipPtr = ^TQAClip;
  182.     TQAClip = RECORD
  183.         clipType:                TQAClipType;
  184.         clip:                    TQAPlatformClip;
  185.     END;
  186.  
  187. {*****************************************************************************
  188.  *
  189.  * Basic data types.
  190.  *
  191.  ****************************************************************************}
  192.  
  193.     TQAEngine = ^LONGINT;
  194.     TQAEnginePtr = ^LONGINT;
  195.     TQATexture = ^LONGINT;
  196.     TQATexturePtr = ^LONGINT;
  197.     TQABitmap = ^LONGINT;
  198.     TQABitmapPtr = ^LONGINT;
  199.     TQADrawPrivate = ^LONGINT;
  200.     TQADrawPrivatePtr = ^LONGINT;
  201.     TQAColorTable = ^LONGINT;
  202.     TQAColorTablePtr = ^LONGINT;
  203. { A single triangle element for QADrawTriMesh }
  204.     TQAIndexedTrianglePtr = ^TQAIndexedTriangle;
  205.     TQAIndexedTriangle = RECORD
  206.         triangleFlags:            UInt32;                                    {  Triangle flags, see kQATriFlags_  }
  207.         vertices:                ARRAY [0..2] OF UInt32;                    {  Indices into a vertex array  }
  208.     END;
  209.  
  210. { An image for use as texture or bitmap }
  211.     TQAImagePtr = ^TQAImage;
  212.     TQAImage = RECORD
  213.         width:                    LONGINT;                                {  Width of pixmap  }
  214.         height:                    LONGINT;                                {  Height of pixmap  }
  215.         rowBytes:                LONGINT;                                {  Rowbytes of pixmap  }
  216.         pixmap:                    Ptr;                                    {  Pixmap  }
  217.     END;
  218.  
  219. { Standard error type }
  220.     TQAError                     = LONGINT;
  221. CONST
  222.     kQANoErr                    = {TQAError}0;                    {  No error  }
  223.     kQAError                    = {TQAError}1;                    {  Generic error flag  }
  224.     kQAOutOfMemory                = {TQAError}2;                    {  Insufficient memory  }
  225.     kQANotSupported                = {TQAError}3;                    {  Requested feature is not supported  }
  226.     kQAOutOfDate                = {TQAError}4;                    {  A newer drawing engine was registered  }
  227.     kQAParamErr                    = {TQAError}5;                    {  Error in passed parameters  }
  228.     kQAGestaltUnknown            = {TQAError}6;                    {  Requested gestalt type isn't available  }
  229.     kQADisplayModeUnsupported    = {TQAError}7;                    {  Engine cannot render to the display in its current ,  }
  230.                                                                 {  mode, but could if it were in some other mode  }
  231.     kQAOutOfVideoMemory            = {TQAError}8;                    {  There is not enough VRAM to support the desired context dimensions  }
  232.  
  233. {***********************************************************************************************
  234.  *
  235.  * Vertex data types.
  236.  *
  237.  **********************************************************************************************}
  238. {
  239.  * TQAVGouraud is used for Gouraud shading. Each vertex specifies position, color and Z.
  240.  *
  241.  * Alpha is always treated as indicating transparency. Drawing engines which don't
  242.  * support Z-sorted rendering use the back-to-front transparency blending functions
  243.  * shown below. (ARGBsrc are the source (new) values, ARGBdest are  the destination
  244.  * (previous) pixel values.)
  245.  *
  246.  *        Premultiplied                            Interpolated
  247.  *
  248.  *        A = 1 - (1 - Asrc) * (1 - Adest)        A = 1 - (1 - Asrc) * (1 - Adest) 
  249.  *        R = (1 - Asrc) * Rdest + Rsrc            R = (1 - Asrc) * Rdest + Asrc * Rsrc
  250.  *        G = (1 - Asrc) * Gdest + Gsrc            G = (1 - Asrc) * Gdest + Asrc * Gsrc
  251.  *        B = (1 - Asrc) * Bdest + Bsrc            B = (1 - Asrc) * Bdest + Asrc * Bsrc
  252.  *
  253.  * Note that the use of other blending modes to implement antialiasing is performed
  254.  * automatically by the drawing engine when the kQATag_Antialias variable !=
  255.  * kQAAntiAlias_Fast. The driving software should continue to use the alpha fields
  256.  * for transparency even when antialiasing is being used (the drawing engine will
  257.  * resolve the multiple blending requirements as best as it can).
  258.  *
  259.  * Drawing engines which perform front-to-back Z-sorted rendering should replace
  260.  * the blending function shown above with the equivalent front-to-back formula.
  261.  }
  262.  
  263. TYPE
  264.     TQAVGouraudPtr = ^TQAVGouraud;
  265.     TQAVGouraud = RECORD
  266.         x:                        Single;                                    {  X pixel coordinate, 0.0 <= x < width  }
  267.         y:                        Single;                                    {  Y pixel coordinate, 0.0 <= y < height  }
  268.         z:                        Single;                                    {  Z coordinate, 0.0 <= z <= 1.0  }
  269.         invW:                    Single;                                    {  1 / w; required only when kQAPerspectiveZ_On is set  }
  270.         r:                        Single;                                    {  Red, 0.0 <= r <= 1.0  }
  271.         g:                        Single;                                    {  Green, 0.0 <= g <= 1.0  }
  272.         b:                        Single;                                    {  Blue, 0.0 <= b <= 1.0  }
  273.         a:                        Single;                                    {  Alpha, 0.0 <= a <= 1.0, 1.0 is opaque  }
  274.     END;
  275.  
  276. {
  277.  * TQAVTexture is used for texture mapping. The texture mapping operation
  278.  * is controlled by the kQATag_TextureOp variable, which is a mask of
  279.  * kQATextureOp_None/Modulate/Highlight/Decal. Below is pseudo-code for the
  280.  * texture shading operation:
  281.  *
  282.  *        texPix = TextureLookup (uq/q, vq/q);
  283.  *        if (kQATextureOp_Decal)
  284.  *        (
  285.  *            texPix.r = texPix.a * texPix.r + (1 - texPix.a) * r;
  286.  *            texPix.g = texPix.a * texPix.g + (1 - texPix.a) * g;
  287.  *            texPix.b = texPix.a * texPix.b + (1 - texPix.a) * b;
  288.  *            texPix.a = a;
  289.  *        )
  290.  *        else
  291.  *        (
  292.  *            texPix.a = texPix.a * a;
  293.  *        )
  294.  *        if (kQATextureOp_Modulate)
  295.  *        (
  296.  *            texPix.r *= kd_r;        // Clamped to prevent overflow
  297.  *            texPix.g *= kd_g;        // Clamped to prevent overflow
  298.  *            texPix.b *= kd_b;        // Clamped to prevent overflow
  299.  *        )
  300.  *        if (kQATextureOp_Highlight)
  301.  *        (
  302.  *            texPix.r += ks_r;        // Clamped to prevent overflow
  303.  *            texPix.g += ks_g;        // Clamped to prevent overflow
  304.  *            texPix.b += ks_b;        // Clamped to prevent overflow
  305.  *        )
  306.  *
  307.  * After computation of texPix, transparency blending (as shown
  308.  * above for TQAVGouraud) is performed.
  309.  }
  310.     TQAVTexturePtr = ^TQAVTexture;
  311.     TQAVTexture = RECORD
  312.         x:                        Single;                                    {  X pixel coordinate, 0.0 <= x < width  }
  313.         y:                        Single;                                    {  Y pixel coordinate, 0.0 <= y < height  }
  314.         z:                        Single;                                    {  Z coordinate, 0.0 <= z <= 1.0  }
  315.         invW:                    Single;                                    {  1 / w (always required)  }
  316.                                                                         {  rgb are used only when kQATextureOp_Decal is set. a is always required  }
  317.         r:                        Single;                                    {  Red, 0.0 <= r <= 1.0  }
  318.         g:                        Single;                                    {  Green, 0.0 <= g <= 1.0  }
  319.         b:                        Single;                                    {  Blue, 0.0 <= b <= 1.0  }
  320.         a:                        Single;                                    {  Alpha, 0.0 <= a <= 1.0, 1.0 is opaque  }
  321.                                                                         {  uOverW and vOverW are required by all modes  }
  322.         uOverW:                    Single;                                    {  u / w  }
  323.         vOverW:                    Single;                                    {  v / w  }
  324.                                                                         {  kd_r/g/b are used only when kQATextureOp_Modulate is set  }
  325.         kd_r:                    Single;                                    {  Scale factor for texture red, 0.0 <= kd_r  }
  326.         kd_g:                    Single;                                    {  Scale factor for texture green, 0.0 <= kd_g  }
  327.         kd_b:                    Single;                                    {  Scale factor for texture blue, 0.0 <= kd_b  }
  328.                                                                         {  ks_r/g/b are used only when kQATextureOp_Highlight is set  }
  329.         ks_r:                    Single;                                    {  Red specular highlight, 0.0 <= ks_r <= 1.0  }
  330.         ks_g:                    Single;                                    {  Green specular highlight, 0.0 <= ks_g <= 1.0  }
  331.         ks_b:                    Single;                                    {  Blue specular highlight, 0.0 <= ks_b <= 1.0  }
  332.     END;
  333.  
  334. {***********************************************************************************************
  335.  *
  336.  * Constants used for the state variables.
  337.  *
  338.  **********************************************************************************************}
  339. {
  340.  * kQATag_xxx is used to select a state variable when calling QASetFloat(), QASetInt(),
  341.  * QAGetFloat() and QAGetInt(). The kQATag values are split into two separate
  342.  * enumerated types: TQATagInt and TQATagFloat. TQATagInt is used for the QASet/GetInt()
  343.  * functions, and TQATagFloat is used for the QASet/GetFloat() functions. (This is so
  344.  * that a compiler that typechecks enums can flag a float/int tag mismatch during compile.)
  345.  *
  346.  * These variables are required by all drawing engines:
  347.  *        kQATag_ZFunction            (Int)    One of kQAZFunction_xxx
  348.  *        kQATag_ColorBG_a            (Float)    Background color alpha
  349.  *        kQATag_ColorBG_r            (Float)    Background color red
  350.  *        kQATag_ColorBG_g            (Float)    Background color green
  351.  *        kQATag_ColorBG_b            (Float)    Background color blue
  352.  *        kQATag_Width                (Float)    Line and point width (pixels)
  353.  *        kQATag_ZMinOffset            (Float)    Min offset to Z to guarantee visibility (Read only!)
  354.  *        kQATag_ZMinScale            (Float)    Min scale to Z to guarantee visibility (Read only!)
  355.  
  356.  * These variables are used for optional features:
  357.  *        kQATag_Antialias            (Int)    One of kQAAntiAlias_xxx
  358.  *        kQATag_Blend                (Int)    One of kQABlend_xxx
  359.  *        kQATag_PerspectiveZ            (Int)    One of kQAPerspectiveZ_xxx
  360.  *        kQATag_TextureFilter        (Int)    One of kQATextureFilter_xxx
  361.  *        kQATag_TextureOp            (Int)    Mask of kQATextureOp_xxx
  362.  *        kQATag_Texture                (Int)    Pointer to current TQATexture
  363.  *        kQATag_CSGTag                (Int)    One of kQACSGTag_xxx
  364.  *        kQATag_CSGEquation            (Int)    32 bit CSG truth table
  365.  *
  366.  * These variables are used for OpenGL™ support:
  367.  *        kQATagGL_DrawBuffer            (Int)    Mask of kQAGL_DrawBuffer_xxx
  368.  *        kQATagGL_TextureWrapU        (Int)    kQAGL_Clamp or kQAGL_Repeat
  369.  *        kQATagGL_TextureWrapV        (Int)    kQAGL_Clamp or kQAGL_Repeat
  370.  *        kQATagGL_TextureMagFilter    (Int)    kQAGL_Nearest or kQAGL_Linear
  371.  *        kQATagGL_TextureMinFilter    (Int)    kQAGL_Nearest, etc.
  372.  *        kQATagGL_ScissorXMin        (Int)    Minimum X value for scissor rectangle
  373.  *        kQATagGL_ScissorYMin        (Int)    Minimum Y value for scissor rectangle
  374.  *        kQATagGL_ScissorXMax        (Int)    Maximum X value for scissor rectangle
  375.  *        kQATagGL_ScissorYMax        (Int)    Maximum Y value for scissor rectangle
  376.  *        kQATagGL_BlendSrc            (Int)    Source blending operation
  377.  *        kQATagGL_BlendDst            (Int)    Destination blending operation
  378.  *        kQATagGL_LinePattern        (Int)    Line rasterization pattern
  379.  *        kQATagGL_AreaPattern0        (Int)    First of 32 area pattern registers
  380.  *        kQATagGL_AreaPattern31        (Int)    Last of 32 area pattern registers
  381.  *        kQATagGL_DepthBG            (Float)    Background Z
  382.  *        kQATagGL_TextureBorder_a    (Float)    Texture border color alpha
  383.  *        kQATagGL_TextureBorder_r    (Float)    Texture border color red
  384.  *        kQATagGL_TextureBorder_g    (Float)    Texture border color green
  385.  *        kQATagGL_TextureBorder_b    (Float)    Texture border color blue
  386.  *
  387.  * Tags >= kQATag_EngineSpecific_Minimum may be assigned by the vendor for use as
  388.  * engine-specific variables. NOTE: These should be used only in exceptional circumstances,
  389.  * as functions performed by these variables won't be generally accessible. All other tag
  390.  * values are reserved.
  391.  *
  392.  *        kQATag_EngineSpecific_Minimum    Minimum tag value for drawing-engine specific variables
  393.  }
  394.     TQATagInt                     = LONGINT;
  395. CONST
  396.     kQATag_ZFunction            = {TQATagInt}0;
  397.     kQATag_Antialias            = {TQATagInt}8;
  398.     kQATag_Blend                = {TQATagInt}9;
  399.     kQATag_PerspectiveZ            = {TQATagInt}10;
  400.     kQATag_TextureFilter        = {TQATagInt}11;
  401.     kQATag_TextureOp            = {TQATagInt}12;
  402.     kQATag_CSGTag                = {TQATagInt}14;
  403.     kQATag_CSGEquation            = {TQATagInt}15;
  404.     kQATag_BufferComposite        = {TQATagInt}16;
  405.     kQATagGL_DrawBuffer            = {TQATagInt}100;
  406.     kQATagGL_TextureWrapU        = {TQATagInt}101;
  407.     kQATagGL_TextureWrapV        = {TQATagInt}102;
  408.     kQATagGL_TextureMagFilter    = {TQATagInt}103;
  409.     kQATagGL_TextureMinFilter    = {TQATagInt}104;
  410.     kQATagGL_ScissorXMin        = {TQATagInt}105;
  411.     kQATagGL_ScissorYMin        = {TQATagInt}106;
  412.     kQATagGL_ScissorXMax        = {TQATagInt}107;
  413.     kQATagGL_ScissorYMax        = {TQATagInt}108;
  414.     kQATagGL_BlendSrc            = {TQATagInt}109;
  415.     kQATagGL_BlendDst            = {TQATagInt}110;
  416.     kQATagGL_LinePattern        = {TQATagInt}111;
  417.     kQATagGL_AreaPattern0        = {TQATagInt}117;                {  ...1-30  }
  418.     kQATagGL_AreaPattern31        = {TQATagInt}148;
  419.     kQATag_EngineSpecific_Minimum = {TQATagInt}1000;
  420.  
  421.  
  422. TYPE
  423.     TQATagPtr                     = LONGINT;
  424. CONST
  425.     kQATag_Texture                = {TQATagPtr}13;
  426.  
  427.  
  428. TYPE
  429.     TQATagFloat                 = LONGINT;
  430. CONST
  431.     kQATag_ColorBG_a            = {TQATagFloat}1;
  432.     kQATag_ColorBG_r            = {TQATagFloat}2;
  433.     kQATag_ColorBG_g            = {TQATagFloat}3;
  434.     kQATag_ColorBG_b            = {TQATagFloat}4;
  435.     kQATag_Width                = {TQATagFloat}5;
  436.     kQATag_ZMinOffset            = {TQATagFloat}6;
  437.     kQATag_ZMinScale            = {TQATagFloat}7;
  438.     kQATagGL_DepthBG            = {TQATagFloat}112;
  439.     kQATagGL_TextureBorder_a    = {TQATagFloat}113;
  440.     kQATagGL_TextureBorder_r    = {TQATagFloat}114;
  441.     kQATagGL_TextureBorder_g    = {TQATagFloat}115;
  442.     kQATagGL_TextureBorder_b    = {TQATagFloat}116;
  443.  
  444. { kQATag_ZFunction }
  445.     kQAZFunction_None            = 0;                            {  Z is neither tested nor written (same as no Z buffer)  }
  446.     kQAZFunction_LT                = 1;                            {  Znew < Zbuffer is visible  }
  447.     kQAZFunction_EQ                = 2;                            {  OpenGL Only: Znew == Zbuffer is visible  }
  448.     kQAZFunction_LE                = 3;                            {  OpenGL Only: Znew <= Zbuffer is visible  }
  449.     kQAZFunction_GT                = 4;                            {  OpenGL Only: Znew > Zbuffer is visible  }
  450.     kQAZFunction_NE                = 5;                            {  OpenGL Only: Znew != Zbuffer is visible  }
  451.     kQAZFunction_GE                = 6;                            {  OpenGL Only: Znew >= Zbuffer is visible  }
  452.     kQAZFunction_True            = 7;                            {  Znew is always visible  }
  453.  
  454. { kQATag_Width }
  455.     kQAMaxWidth = 128.0;
  456. { kQATag_Antialias }
  457.     kQAAntiAlias_Off            = 0;
  458.     kQAAntiAlias_Fast            = 1;
  459.     kQAAntiAlias_Mid            = 2;
  460.     kQAAntiAlias_Best            = 3;
  461.  
  462. { kQATag_Blend }
  463.     kQABlend_PreMultiply        = 0;
  464.     kQABlend_Interpolate        = 1;
  465.     kQABlend_OpenGL                = 2;
  466.  
  467. { kQATag_BufferComposite }
  468.     kQABufferComposite_None        = 0;                            {  Default: New pixels overwrite initial buffer contents  }
  469.     kQABufferComposite_PreMultiply = 1;                            {  New pixels are blended with initial buffer contents via PreMultiply  }
  470.     kQABufferComposite_Interpolate = 2;                            {  New pixels are blended with initial buffer contents via Interpolate  }
  471.  
  472. { kQATag_PerspectiveZ }
  473.     kQAPerspectiveZ_Off            = 0;                            {  Use Z for hidden surface removal  }
  474.     kQAPerspectiveZ_On            = 1;                            {  Use InvW for hidden surface removal  }
  475.  
  476. { kQATag_TextureFilter }
  477.                                                                 {  suggested meanings of these values  }
  478.     kQATextureFilter_Fast        = 0;                            {  No filtering, pick nearest  }
  479.     kQATextureFilter_Mid        = 1;                            {  Fastest method that does some filtering  }
  480.     kQATextureFilter_Best        = 2;                            {  Highest quality renderer can do  }
  481.  
  482. { kQATag_TextureOp (mask of one or more) }
  483.     kQATextureOp_None            = 0;                            {  Default texture mapping mode  }
  484.     kQATextureOp_Modulate        = $01;                            {  Modulate texture color with kd_r/g/b  }
  485.     kQATextureOp_Highlight        = $02;                            {  Add highlight value ks_r/g/b  }
  486.     kQATextureOp_Decal            = $04;                            {  When texture alpha == 0, use rgb instead  }
  487.     kQATextureOp_Shrink            = $08;                            {  This is a non-wrapping texture, so the ???  }
  488.  
  489. { kQATag_CSGTag }
  490.     kQACSGTag_0                    = 0;                            {  Submitted tris have CSG ID 0  }
  491.     kQACSGTag_1                    = 1;                            {  Submitted tris have CSG ID 1  }
  492.     kQACSGTag_2                    = 2;                            {  Submitted tris have CSG ID 2  }
  493.     kQACSGTag_3                    = 3;                            {  Submitted tris have CSG ID 3  }
  494.     kQACSGTag_4                    = 4;                            {  Submitted tris have CSG ID 4  }
  495.  
  496. { kQATagGL_TextureWrapU/V }
  497.     kQAGL_Repeat                = 0;
  498.     kQAGL_Clamp                    = 1;
  499.  
  500. { kQATagGL_BlendSrc }
  501.     kQAGL_SourceBlend_XXX        = 0;
  502.  
  503. { kQATagGL_BlendDst }
  504.     kQAGL_DestBlend_XXX            = 0;
  505.  
  506. { kQATagGL_DrawBuffer (mask of one or more) }
  507.     kQAGL_DrawBuffer_None        = 0;
  508.     kQAGL_DrawBuffer_FrontLeft    = $01;
  509.     kQAGL_DrawBuffer_FrontRight    = $02;
  510.     kQAGL_DrawBuffer_BackLeft    = $04;
  511.     kQAGL_DrawBuffer_BackRight    = $08;
  512.     kQAGL_DrawBuffer_Front        = $03;
  513.     kQAGL_DrawBuffer_Back        = $0C;
  514.  
  515. {***********************************************************************************************
  516.  *
  517.  * Constants used as function parameters.
  518.  *
  519.  **********************************************************************************************}
  520. {
  521.  * TQAVertexMode is a parameter to QADrawVGouraud() and QADrawVTexture() that specifies how
  522.  * to interpret and draw the vertex array.
  523.  }
  524.  
  525. TYPE
  526.     TQAVertexMode                 = LONGINT;
  527. CONST
  528.     kQAVertexMode_Point            = {TQAVertexMode}0;                {  Draw nVertices points  }
  529.     kQAVertexMode_Line            = {TQAVertexMode}1;                {  Draw nVertices/2 line segments  }
  530.     kQAVertexMode_Polyline        = {TQAVertexMode}2;                {  Draw nVertices-1 connected line segments  }
  531.     kQAVertexMode_Tri            = {TQAVertexMode}3;                {  Draw nVertices/3 triangles  }
  532.     kQAVertexMode_Strip            = {TQAVertexMode}4;                {  Draw nVertices-2 triangles as a strip  }
  533.     kQAVertexMode_Fan            = {TQAVertexMode}5;                {  Draw nVertices-2 triangles as a fan from v0  }
  534.     kQAVertexMode_NumModes        = {TQAVertexMode}6;
  535.  
  536. {
  537.  * TQAGestaltSelector is a parameter to QAEngineGestalt(). It selects which gestalt
  538.  * parameter will be copied into 'response'.
  539.  }
  540.  
  541. TYPE
  542.     TQAGestaltSelector             = LONGINT;
  543. CONST
  544.     kQAGestalt_OptionalFeatures    = {TQAGestaltSelector}0;        {  Mask of one or more kQAOptional_xxx  }
  545.     kQAGestalt_FastFeatures        = {TQAGestaltSelector}1;        {  Mask of one or more kQAFast_xxx  }
  546.     kQAGestalt_VendorID            = {TQAGestaltSelector}2;        {  Vendor ID  }
  547.     kQAGestalt_EngineID            = {TQAGestaltSelector}3;        {  Engine ID  }
  548.     kQAGestalt_Revision            = {TQAGestaltSelector}4;        {  Revision number of this engine  }
  549.     kQAGestalt_ASCIINameLength    = {TQAGestaltSelector}5;        {  strlen (asciiName)  }
  550.     kQAGestalt_ASCIIName        = {TQAGestaltSelector}6;        {  Causes strcpy (response, asciiName)  }
  551.     kQAGestalt_TextureMemory    = {TQAGestaltSelector}7;        {  amount of texture RAM currently available  }
  552.     kQAGestalt_FastTextureMemory = {TQAGestaltSelector}8;        {  amount of texture RAM currently available  }
  553.     kQAGestalt_NumSelectors        = {TQAGestaltSelector}9;
  554.  
  555. {
  556.  * TQAMethodSelector is a parameter to QASetNoticeMethod to select the notice method
  557.  }
  558.  
  559. TYPE
  560.     TQAMethodSelector             = LONGINT;
  561. CONST
  562.     kQAMethod_RenderCompletion    = {TQAMethodSelector}0;            {  Called when rendering has completed and buffers swapped  }
  563.     kQAMethod_DisplayModeChanged = {TQAMethodSelector}1;        {  Called when a display mode has changed  }
  564.     kQAMethod_ReloadTextures    = {TQAMethodSelector}2;            {  Called when texture memory has been invalidated  }
  565.     kQAMethod_BufferInitialize    = {TQAMethodSelector}3;            {  Called when a buffer needs to be initialized  }
  566.     kQAMethod_BufferComposite    = {TQAMethodSelector}4;            {  Called when rendering is finished and its safe to composite  }
  567.     kQAMethod_NumSelectors        = {TQAMethodSelector}5;
  568.  
  569. {
  570.  * kQATriFlags_xxx are ORed together to generate the 'flags' parameter
  571.  * to QADrawTriGouraud() and QADrawTriTexture().
  572.  }
  573.     kQATriFlags_None            = 0;                            {  No flags (triangle is front-facing or don't care)  }
  574.     kQATriFlags_Backfacing        = $01;                            {  Triangle is back-facing  }
  575.  
  576. {
  577.  * kQATexture_xxx are ORed together to generate the 'flags' parameter to QATextureNew().
  578.  }
  579.     kQATexture_None                = 0;                            {  No flags  }
  580.     kQATexture_Lock                = $01;                            {  Don't swap this texture out  }
  581.     kQATexture_Mipmap            = $02;                            {  This texture is mipmapped  }
  582.     kQATexture_NoCompression    = $04;                            {  Do not compress this texture  }
  583.     kQATexture_HighCompression    = $08;                            {  Compress texture, even if it takes a while  }
  584.  
  585. {
  586.  * kQABitmap_xxx are ORed together to generate the 'flags' parameter to QABitmapNew().
  587.  }
  588.     kQABitmap_None                = 0;                            {  No flags  }
  589.     kQABitmap_Lock                = $02;                            {  Don't swap this bitmap out  }
  590.     kQABitmap_NoCompression        = $04;                            {  Do not compress this bitmap  }
  591.     kQABitmap_HighCompression    = $08;                            {  Compress bitmap, even if it takes a while  }
  592.  
  593. {
  594.  * kQAContext_xxx are ORed together to generate the 'flags' parameter for QADrawContextNew().
  595.  }
  596.     kQAContext_None                = 0;                            {  No flags  }
  597.     kQAContext_NoZBuffer        = $01;                            {  No hidden surface removal  }
  598.     kQAContext_DeepZ            = $02;                            {  Hidden surface precision >= 24 bits  }
  599.     kQAContext_DoubleBuffer        = $04;                            {  Double buffered window  }
  600.     kQAContext_Cache            = $08;                            {  This is a cache context  }
  601.     kQAContext_NoDither            = $10;                            {  No dithering, straight color banding  }
  602.  
  603. {
  604.  * kQAOptional_xxx are ORed together to generate the kQAGestalt_OptionalFeatures response
  605.  * from QAEngineGestalt().
  606.  }
  607.     kQAOptional_None            = 0;                            {  No optional features  }
  608.     kQAOptional_DeepZ            = $01;                            {  Hidden surface precision >= 24 bits  }
  609.     kQAOptional_Texture            = $02;                            {  Texture mapping  }
  610.     kQAOptional_TextureHQ        = $04;                            {  High quality texture (tri-linear mip or better)  }
  611.     kQAOptional_TextureColor    = $08;                            {  Full color modulation and highlight of textures  }
  612.     kQAOptional_Blend            = $10;                            {  Transparency blending of RGB  }
  613.     kQAOptional_BlendAlpha        = $20;                            {  Transparency blending includes alpha channel  }
  614.     kQAOptional_Antialias        = $40;                            {  Antialiased rendering  }
  615.     kQAOptional_ZSorted            = $80;                            {  Z sorted rendering (for transparency, etc.)  }
  616.     kQAOptional_PerspectiveZ    = $0100;                        {  Hidden surface removal using InvW instead of Z  }
  617.     kQAOptional_OpenGL            = $0200;                        {  Extended rasterization features for OpenGL™  }
  618.     kQAOptional_NoClear            = $0400;                        {  This drawing engine doesn't clear before drawing  }
  619.     kQAOptional_CSG                = $0800;                        {  kQATag_CSGxxx are implemented  }
  620.     kQAOptional_BoundToDevice    = $1000;                        {  This engine is tightly bound to GDevice  }
  621.     kQAOptional_CL4                = $2000;                        {  This engine suports kQAPixel_CL4  }
  622.     kQAOptional_CL8                = $4000;                        {  This engine suports kQAPixel_CL8  }
  623.     kQAOptional_BufferComposite    = $8000;                        {  This engine can composite with initial buffer contents  }
  624.     kQAOptional_NoDither        = $00010000;                    {  This engine can draw with no dithering  }
  625.  
  626. {
  627.  * kQAFast_xxx are ORed together to generate the kQAGestalt_FastFeatures response
  628.  * from QAEngineGestalt().
  629.  }
  630.     kQAFast_None                = 0;                            {  No accelerated features  }
  631.     kQAFast_Line                = $01;                            {  Line drawing  }
  632.     kQAFast_Gouraud                = $02;                            {  Gouraud shaded triangles  }
  633.     kQAFast_Texture                = $04;                            {  Texture mapped triangles  }
  634.     kQAFast_TextureHQ            = $08;                            {  High quality texture (tri-linear mip or better)  }
  635.     kQAFast_Blend                = $10;                            {  Transparency blending  }
  636.     kQAFast_Antialiasing        = $20;                            {  Antialiased rendering  }
  637.     kQAFast_ZSorted                = $40;                            {  Z sorted rendering of non-opaque objects  }
  638.     kQAFast_CL4                    = $80;                            {  This engine accelerates kQAPixel_CL4  }
  639.     kQAFast_CL8                    = $0100;                        {  This engine accelerates kQAPixel_CL8  }
  640.  
  641.  
  642.  
  643.  
  644. {*******************************************************************
  645.  * TQAVersion sets the TQADrawContext 'version' field. It is set by
  646.  * the manager to indicate the version of the TQADrawContext structure.
  647.  ******************************************************************}
  648.  
  649. TYPE
  650.     TQAVersion                     = LONGINT;
  651. CONST
  652.     kQAVersion_Prerelease        = {TQAVersion}0;
  653.     kQAVersion_1_0                = {TQAVersion}1;
  654.     kQAVersion_1_0_5            = {TQAVersion}2;                {  Added tri mesh functions, color tables  }
  655.     kQAVersion_1_5                = {TQAVersion}3;                {  Added call backs, texture compression, and new error return code  }
  656.  
  657.  
  658.  
  659. {**********************************************************************
  660.  * TQADrawContext structure holds method pointers.
  661.  * This is a forward refrence. The structure is defined later.
  662.  *********************************************************************}
  663.  
  664. TYPE
  665.     TQADrawContextPtr = ^TQADrawContext;
  666. {***********************************************************************************************
  667.  *
  668.  * Typedefs of draw method functions provided by the drawing engine. One function pointer
  669.  * for each of these function types in stored in the TQADrawContext public data structure.
  670.  *
  671.  * These functions should be accessed through the QA<function>(context,...) macros,
  672.  * defined above.
  673.  *
  674.  **********************************************************************************************}
  675. {$IFC TYPED_FUNCTION_POINTERS}
  676.     TQAStandardNoticeMethod = PROCEDURE({CONST}VAR drawContext: TQADrawContext; refCon: UNIV Ptr); C;
  677. {$ELSEC}
  678.     TQAStandardNoticeMethod = ProcPtr;
  679. {$ENDC}
  680.  
  681. {$IFC TYPED_FUNCTION_POINTERS}
  682.     TQABufferNoticeMethod = PROCEDURE({CONST}VAR drawContext: TQADrawContext; {CONST}VAR buffer: TQADevice; {CONST}VAR dirtyRect: TQARect; refCon: UNIV Ptr); C;
  683. {$ELSEC}
  684.     TQABufferNoticeMethod = ProcPtr;
  685. {$ENDC}
  686.  
  687.     TQANoticeMethodPtr = ^TQANoticeMethod;
  688.     TQANoticeMethod = RECORD
  689.         CASE INTEGER OF
  690.         0: (
  691.             standardNoticeMethod: TQAStandardNoticeMethod;                {  Used for non-buffer related methods  }
  692.             );
  693.         1: (
  694.             bufferNoticeMethod:    TQABufferNoticeMethod;                    {  Used for buffer handling methods  }
  695.             );
  696.     END;
  697.  
  698. {$IFC TYPED_FUNCTION_POINTERS}
  699.     TQASetFloat = PROCEDURE(VAR drawContext: TQADrawContext; tag: TQATagFloat; newValue: Single); C;
  700. {$ELSEC}
  701.     TQASetFloat = ProcPtr;
  702. {$ENDC}
  703.  
  704. {$IFC TYPED_FUNCTION_POINTERS}
  705.     TQASetInt = PROCEDURE(VAR drawContext: TQADrawContext; tag: TQATagInt; newValue: UInt32); C;
  706. {$ELSEC}
  707.     TQASetInt = ProcPtr;
  708. {$ENDC}
  709.  
  710. {$IFC TYPED_FUNCTION_POINTERS}
  711.     TQASetPtr = PROCEDURE(VAR drawContext: TQADrawContext; tag: TQATagPtr; newValue: UNIV Ptr); C;
  712. {$ELSEC}
  713.     TQASetPtr = ProcPtr;
  714. {$ENDC}
  715.  
  716. {$IFC TYPED_FUNCTION_POINTERS}
  717.     TQAGetFloat = FUNCTION({CONST}VAR drawContext: TQADrawContext; tag: TQATagFloat): Single; C;
  718. {$ELSEC}
  719.     TQAGetFloat = ProcPtr;
  720. {$ENDC}
  721.  
  722. {$IFC TYPED_FUNCTION_POINTERS}
  723.     TQAGetInt = FUNCTION({CONST}VAR drawContext: TQADrawContext; tag: TQATagInt): UInt32; C;
  724. {$ELSEC}
  725.     TQAGetInt = ProcPtr;
  726. {$ENDC}
  727.  
  728. {$IFC TYPED_FUNCTION_POINTERS}
  729.     TQAGetPtr = FUNCTION({CONST}VAR drawContext: TQADrawContext; tag: TQATagPtr): Ptr; C;
  730. {$ELSEC}
  731.     TQAGetPtr = ProcPtr;
  732. {$ENDC}
  733.  
  734. {$IFC TYPED_FUNCTION_POINTERS}
  735.     TQADrawPoint = PROCEDURE({CONST}VAR drawContext: TQADrawContext; {CONST}VAR v: TQAVGouraud); C;
  736. {$ELSEC}
  737.     TQADrawPoint = ProcPtr;
  738. {$ENDC}
  739.  
  740. {$IFC TYPED_FUNCTION_POINTERS}
  741.     TQADrawLine = PROCEDURE({CONST}VAR drawContext: TQADrawContext; {CONST}VAR v0: TQAVGouraud; {CONST}VAR v1: TQAVGouraud); C;
  742. {$ELSEC}
  743.     TQADrawLine = ProcPtr;
  744. {$ENDC}
  745.  
  746. {$IFC TYPED_FUNCTION_POINTERS}
  747.     TQADrawTriGouraud = PROCEDURE({CONST}VAR drawContext: TQADrawContext; {CONST}VAR v0: TQAVGouraud; {CONST}VAR v1: TQAVGouraud; {CONST}VAR v2: TQAVGouraud; flags: UInt32); C;
  748. {$ELSEC}
  749.     TQADrawTriGouraud = ProcPtr;
  750. {$ENDC}
  751.  
  752. {$IFC TYPED_FUNCTION_POINTERS}
  753.     TQADrawTriTexture = PROCEDURE({CONST}VAR drawContext: TQADrawContext; {CONST}VAR v0: TQAVTexture; {CONST}VAR v1: TQAVTexture; {CONST}VAR v2: TQAVTexture; flags: UInt32); C;
  754. {$ELSEC}
  755.     TQADrawTriTexture = ProcPtr;
  756. {$ENDC}
  757.  
  758. {$IFC TYPED_FUNCTION_POINTERS}
  759.     TQASubmitVerticesGouraud = PROCEDURE({CONST}VAR drawContext: TQADrawContext; nVertices: UInt32; {CONST}VAR vertices: TQAVGouraud); C;
  760. {$ELSEC}
  761.     TQASubmitVerticesGouraud = ProcPtr;
  762. {$ENDC}
  763.  
  764. {$IFC TYPED_FUNCTION_POINTERS}
  765.     TQASubmitVerticesTexture = PROCEDURE({CONST}VAR drawContext: TQADrawContext; nVertices: UInt32; {CONST}VAR vertices: TQAVTexture); C;
  766. {$ELSEC}
  767.     TQASubmitVerticesTexture = ProcPtr;
  768. {$ENDC}
  769.  
  770. {$IFC TYPED_FUNCTION_POINTERS}
  771.     TQADrawTriMeshGouraud = PROCEDURE({CONST}VAR drawContext: TQADrawContext; nTriangles: UInt32; {CONST}VAR triangles: TQAIndexedTriangle); C;
  772. {$ELSEC}
  773.     TQADrawTriMeshGouraud = ProcPtr;
  774. {$ENDC}
  775.  
  776. {$IFC TYPED_FUNCTION_POINTERS}
  777.     TQADrawTriMeshTexture = PROCEDURE({CONST}VAR drawContext: TQADrawContext; nTriangles: UInt32; {CONST}VAR triangles: TQAIndexedTriangle); C;
  778. {$ELSEC}
  779.     TQADrawTriMeshTexture = ProcPtr;
  780. {$ENDC}
  781.  
  782. {$IFC TYPED_FUNCTION_POINTERS}
  783.     TQADrawVGouraud = PROCEDURE({CONST}VAR drawContext: TQADrawContext; nVertices: UInt32; vertexMode: TQAVertexMode; {CONST}VAR vertices: TQAVGouraud; {CONST}VAR flags: UInt32); C;
  784. {$ELSEC}
  785.     TQADrawVGouraud = ProcPtr;
  786. {$ENDC}
  787.  
  788. {$IFC TYPED_FUNCTION_POINTERS}
  789.     TQADrawVTexture = PROCEDURE({CONST}VAR drawContext: TQADrawContext; nVertices: UInt32; vertexMode: TQAVertexMode; {CONST}VAR vertices: TQAVTexture; {CONST}VAR flags: UInt32); C;
  790. {$ELSEC}
  791.     TQADrawVTexture = ProcPtr;
  792. {$ENDC}
  793.  
  794. {$IFC TYPED_FUNCTION_POINTERS}
  795.     TQADrawBitmap = PROCEDURE({CONST}VAR drawContext: TQADrawContext; {CONST}VAR v: TQAVGouraud; VAR bitmap: TQABitmap); C;
  796. {$ELSEC}
  797.     TQADrawBitmap = ProcPtr;
  798. {$ENDC}
  799.  
  800. {$IFC TYPED_FUNCTION_POINTERS}
  801.     TQARenderStart = PROCEDURE({CONST}VAR drawContext: TQADrawContext; {CONST}VAR dirtyRect: TQARect; {CONST}VAR initialContext: TQADrawContext); C;
  802. {$ELSEC}
  803.     TQARenderStart = ProcPtr;
  804. {$ENDC}
  805.  
  806. {$IFC TYPED_FUNCTION_POINTERS}
  807.     TQARenderEnd = FUNCTION({CONST}VAR drawContext: TQADrawContext; {CONST}VAR modifiedRect: TQARect): TQAError; C;
  808. {$ELSEC}
  809.     TQARenderEnd = ProcPtr;
  810. {$ENDC}
  811.  
  812. {$IFC TYPED_FUNCTION_POINTERS}
  813.     TQARenderAbort = FUNCTION({CONST}VAR drawContext: TQADrawContext): TQAError; C;
  814. {$ELSEC}
  815.     TQARenderAbort = ProcPtr;
  816. {$ENDC}
  817.  
  818. {$IFC TYPED_FUNCTION_POINTERS}
  819.     TQAFlush = FUNCTION({CONST}VAR drawContext: TQADrawContext): TQAError; C;
  820. {$ELSEC}
  821.     TQAFlush = ProcPtr;
  822. {$ENDC}
  823.  
  824. {$IFC TYPED_FUNCTION_POINTERS}
  825.     TQASync = FUNCTION({CONST}VAR drawContext: TQADrawContext): TQAError; C;
  826. {$ELSEC}
  827.     TQASync = ProcPtr;
  828. {$ENDC}
  829.  
  830. {$IFC TYPED_FUNCTION_POINTERS}
  831.     TQASetNoticeMethod = FUNCTION({CONST}VAR drawContext: TQADrawContext; method: TQAMethodSelector; completionCallBack: TQANoticeMethod; refCon: UNIV Ptr): TQAError; C;
  832. {$ELSEC}
  833.     TQASetNoticeMethod = ProcPtr;
  834. {$ENDC}
  835.  
  836. {$IFC TYPED_FUNCTION_POINTERS}
  837.     TQAGetNoticeMethod = FUNCTION({CONST}VAR drawContext: TQADrawContext; method: TQAMethodSelector; VAR completionCallBack: TQANoticeMethod; VAR refCon: UNIV Ptr): TQAError; C;
  838. {$ELSEC}
  839.     TQAGetNoticeMethod = ProcPtr;
  840. {$ENDC}
  841.  
  842. {***********************************************************************************************
  843.  *
  844.  * Public TQADrawContext structure. This contains function pointers for the chosen
  845.  * drawing engine.
  846.  *
  847.  **********************************************************************************************}
  848.     TQADrawContext = RECORD
  849.         drawPrivate:            TQADrawPrivatePtr;                        {  Engine's private data for this context  }
  850.         version:                TQAVersion;                                {  Version number  }
  851.         setFloat:                TQASetFloat;                            {  Method: Set a float state variable  }
  852.         setInt:                    TQASetInt;                                {  Method: Set an unsigned long state variable  }
  853.         setPtr:                    TQASetPtr;                                {  Method: Set an unsigned long state variable  }
  854.         getFloat:                TQAGetFloat;                            {  Method: Get a float state variable  }
  855.         getInt:                    TQAGetInt;                                {  Method: Get an unsigned long state variable  }
  856.         getPtr:                    TQAGetPtr;                                {  Method: Get an pointer state variable  }
  857.         drawPoint:                TQADrawPoint;                            {  Method: Draw a point  }
  858.         drawLine:                TQADrawLine;                            {  Method: Draw a line  }
  859.         drawTriGouraud:            TQADrawTriGouraud;                        {  Method: Draw a Gouraud shaded triangle  }
  860.         drawTriTexture:            TQADrawTriTexture;                        {  Method: Draw a texture mapped triangle  }
  861.         drawVGouraud:            TQADrawVGouraud;                        {  Method: Draw Gouraud vertices  }
  862.         drawVTexture:            TQADrawVTexture;                        {  Method: Draw texture vertices  }
  863.         drawBitmap:                TQADrawBitmap;                            {  Method: Draw a bitmap  }
  864.         renderStart:            TQARenderStart;                            {  Method: Initialize for rendering  }
  865.         renderEnd:                TQARenderEnd;                            {  Method: Complete rendering and display  }
  866.         renderAbort:            TQARenderAbort;                            {  Method: Abort any outstanding rendering (blocking)  }
  867.         flush:                    TQAFlush;                                {  Method: Start render of any queued commands (non-blocking)  }
  868.         sync:                    TQASync;                                {  Method: Wait for completion of all rendering (blocking)  }
  869.         submitVerticesGouraud:    TQASubmitVerticesGouraud;                {  Method: Submit Gouraud vertices for trimesh  }
  870.         submitVerticesTexture:    TQASubmitVerticesTexture;                {  Method: Submit Texture vertices for trimesh  }
  871.         drawTriMeshGouraud:        TQADrawTriMeshGouraud;                    {  Method: Draw a Gouraud triangle mesh  }
  872.         drawTriMeshTexture:        TQADrawTriMeshTexture;                    {  Method: Draw a Texture triangle mesh  }
  873.         setNoticeMethod:        TQASetNoticeMethod;                        {  Method: Set a notice method  }
  874.         getNoticeMethod:        TQAGetNoticeMethod;                        {  Method: Get a notice method  }
  875.     END;
  876.  
  877. {***********************************************************************************************
  878.  *
  879.  * Acceleration manager function prototypes.
  880.  *
  881.  **********************************************************************************************}
  882. FUNCTION QADrawContextNew({CONST}VAR device: TQADevice; {CONST}VAR rect: TQARect; {CONST}VAR clip: TQAClip; {CONST}VAR engine: TQAEngine; flags: UInt32; VAR newDrawContext: TQADrawContextPtr): TQAError; C;
  883. PROCEDURE QADrawContextDelete(VAR drawContext: TQADrawContext); C;
  884. FUNCTION QAColorTableNew({CONST}VAR engine: TQAEngine; tableType: TQAColorTableType; pixelData: UNIV Ptr; transparentIndexFlag: LONGINT; VAR newTable: TQAColorTablePtr): TQAError; C;
  885. PROCEDURE QAColorTableDelete({CONST}VAR engine: TQAEngine; VAR colorTable: TQAColorTable); C;
  886. FUNCTION QATextureNew({CONST}VAR engine: TQAEngine; flags: UInt32; pixelType: TQAImagePixelType; {CONST}VAR images: TQAImage; VAR newTexture: TQATexturePtr): TQAError; C;
  887. FUNCTION QATextureDetach({CONST}VAR engine: TQAEngine; VAR texture: TQATexture): TQAError; C;
  888. PROCEDURE QATextureDelete({CONST}VAR engine: TQAEngine; VAR texture: TQATexture); C;
  889. FUNCTION QATextureBindColorTable({CONST}VAR engine: TQAEngine; VAR texture: TQATexture; VAR colorTable: TQAColorTable): TQAError; C;
  890. FUNCTION QABitmapNew({CONST}VAR engine: TQAEngine; flags: UInt32; pixelType: TQAImagePixelType; {CONST}VAR image: TQAImage; VAR newBitmap: TQABitmapPtr): TQAError; C;
  891. FUNCTION QABitmapDetach({CONST}VAR engine: TQAEngine; VAR bitmap: TQABitmap): TQAError; C;
  892. PROCEDURE QABitmapDelete({CONST}VAR engine: TQAEngine; VAR bitmap: TQABitmap); C;
  893. FUNCTION QABitmapBindColorTable({CONST}VAR engine: TQAEngine; VAR bitmap: TQABitmap; VAR colorTable: TQAColorTable): TQAError; C;
  894. FUNCTION QADeviceGetFirstEngine({CONST}VAR device: TQADevice): TQAEnginePtr; C;
  895. FUNCTION QADeviceGetNextEngine({CONST}VAR device: TQADevice; {CONST}VAR currentEngine: TQAEngine): TQAEnginePtr; C;
  896. FUNCTION QAEngineCheckDevice({CONST}VAR engine: TQAEngine; {CONST}VAR device: TQADevice): TQAError; C;
  897. FUNCTION QAEngineGestalt({CONST}VAR engine: TQAEngine; selector: TQAGestaltSelector; response: UNIV Ptr): TQAError; C;
  898. FUNCTION QAEngineEnable(vendorID: LONGINT; engineID: LONGINT): TQAError; C;
  899. FUNCTION QAEngineDisable(vendorID: LONGINT; engineID: LONGINT): TQAError; C;
  900.  
  901. {$IFC TARGET_OS_MAC }
  902. FUNCTION QARegisterDrawNotificationProc(VAR globalRect: Rect; proc: TQADrawNotificationProcPtr; refCon: LONGINT; VAR refNum: TQADrawNotificationProcRefNum): TQAError; C;
  903. FUNCTION QAUnregisterDrawNotificationProc(refNum: TQADrawNotificationProcRefNum): TQAError; C;
  904. {$ENDC}  {TARGET_OS_MAC}
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912. {$ALIGN RESET}
  913. {$POP}
  914.  
  915. {$SETC UsingIncludes := RAVEIncludes}
  916.  
  917. {$ENDC} {__RAVE__}
  918.  
  919. {$IFC NOT UsingIncludes}
  920.  END.
  921. {$ENDC}
  922.